A capacitive sensor generally includes an electrode or an array of electrodes. When an object such as a finger or stylus is brought within range of an electrode, the capacitance of the electrode is changed by an amount that depends, at least in part, on the distance from the object to the electrode. For example, a set of electrodes may be arranged in parallel to define a sensing region, and the position of an object relative to the sensing region can be determined based upon the change in capacitance per electrode induced by the object. In simple terms, a profile of capacitance versus electrode can be used to unambiguously determine the position of an object in, for example, the x-direction—the x-coordinate corresponds to the peak of the profile. A second set of parallel electrodes arrayed perpendicular to the first set can be similarly used to determine the position of the object in the y-direction. A single electrode can be used to determine proximity (the z-direction).
Accurate measurements of capacitance changes induced by an object are needed so that the position of the object can be accurately determined. Accurate measurements of the background capacitance (e.g., the about of capacitance that is present even if an object is not in proximity) are also needed to account for noise that may be introduced by changes in ambient temperature or the presence of contaminants on the surface of the sensor, for example.